<template>
  <QueryBar :inputs="qeuryInputs" url="get_chart2_field_options" @submit="submit" />

  <MyTable url="query_devs" :defaultParams="{
    startTime: 1609459200000,
    endTime: 1686937922776,
  }" ref="table" :columns="columns" defaultCellWidth="130px">
    <template #operator = {row}>
      <lay-button size="xs" type="primary" @click="edit(row)">编辑</lay-button>
      <lay-button size="xs" @click="details(row)">查看</lay-button>
    </template>
  </MyTable>
</template>

<script setup>
import MyTable from "@/components/MyTable/index.vue";
import QueryBar from "@/components/QueryBar/index.vue";
import dayjs from "dayjs";
import { ref } from "vue";

const table = ref(null);

function submit(row) {
  table.value.reload(row)
}
const edit = (row) => {
  console.log(row)
}
const details = (row) => {

}
const columns = ref([
  { title: "所属科室", width: "200px", key: "所属科室", fixed: "left" },
  { title: "设备名称", key: "设备名称", fixed: "left" },
  { title: "设备分类", key: "设备分类", fixed: "left" },
  { title: "设备品牌", key: "设备品牌" },
  { title: "规格型号", key: "规格型号" },
  { title: "SN", key: "SN" },
  { title: "收购日期", key: "收购日期" },
  { title: "资金来源", key: "资金来源" },
  { title: "设备状态", key: "设备状态" },
  { title: "登账类型", key: "登账类型" },
  { title: "收购日期", key: "收购日期" },
  { title: "资金来源", key: "资金来源" },
  { title: "设备状态", key: "设备状态" },
  { title: "登账类型", key: "登账类型" },
  {
    title: "操作",
    customSlot: "operator",
    key: "operator",
    fixed: "right",
  },
]);

const qeuryInputs = [
  {
    key: "所属科室",
    type: "input",
  },
  {
    key: "设备名称",
    type: "input",
  },
  {
    key: "SN",
    type: "input",
  },
  {
    key: "设备编号",
    type: "input",
  }
];
</script>

<style></style>